﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;

namespace GoGrid
{
    public class BillingToken
    {
        public Connection Connection { get; set; }

        public static BillingToken CreateFromXmlNode(XmlNode objectElementNode, Connection connection)
        {
            BillingToken output = new BillingToken();
            output.Connection = connection;

            output.ID = InternalHelper.GetAttributeElementValueFromXmlNodeAsNullableInt32(objectElementNode, "id");
            output.Name = InternalHelper.GetAttributeElementValueFromXmlNodeAsString(objectElementNode, "name");
            output.Price = InternalHelper.GetAttributeElementValueFromXmlNodeAsDecimal(objectElementNode, "price");

            return output;
        }

        public int? ID { get; set; }
        public string Name { get; set; }
        public decimal Price { get; set; }
    }
}